#ifndef __KYO_DICT_H__
#define __KYO_DICT_H__

#include <sdl.h>
#include <list.h>
#include <hash.h>
#include <my_debug.h>

#define W               480
#define H               272
#define BPP             32

#define CIKU_PATH       "./ciku.dict"

#define FONT_PATH       "./simfang.ttf"
#define FONT_SIZE       16
#define FONT_COLOR      0x0

#define INPUT_H         30
#define INPUT_W         W

#define LIKE_W          120
#define LIKE_H          (H - INPUT_H)

#define LINE_W          5
#define LINE_COLOR      0x0

#define C_BG            0xCCCCCC

#define BUF_MAX         8192
#define INPUT_MAX       30
#define WORD_MAX        14

#define KYO_TO_COLOR(c) (SDL_Color)     \
        {                               \
            (char)(c >> 16),            \
            (char)(c >> 8),             \
            (char)c                     \
        }

typedef struct dict_t {
    NODE list;
    int node_num;
    HASH *hash;
    TTF_Font *font;
    SDL_Surface *screen;
    struct sdl_t *sdl;
    char input[INPUT_MAX];
    int input_num;
    char *find_cn;
    char *word[WORD_MAX];
    int word_num;
    char buf[BUF_MAX];
}DICT;

DICT *dict_init(void);
void dict_show(DICT *);
int dict_run(DICT *, int isexit);
void dict_exit(DICT *);


#endif /* __KYO_DICT_H__ */
